class Config:
    HOSTNAME = '127.0.0.1'
    PORT = '3306'
    DATABASE = 'shop'
    USERNAME = 'root'
    PASSWORD = 'root'
    DB_URI = 'mysql+mysqldb://{}:{}@{}:{}/{}?charset=utf8mb4'.format(USERNAME, PASSWORD, HOSTNAME, PORT, DATABASE)
    SQLALCHEMY_DATABASE_URI = DB_URI
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 不需要跟踪数据的修改


# 开发环境下的配置
class DevelopmentConfig(Config):
    Debug = True
    SQLALCHEMY_ECHO = True  # 打印日志


# 生产环境下的配置
class ProductConfig(Config):
    pass


map_config = {
    'develop': DevelopmentConfig,
    'product': ProductConfig
}
